var userInp = document.getElementsByClassName('user')[0]
var pwdInp = document.getElementsByClassName('pwd')[0]
var submit = document.getElementsByClassName('submit')[0]

submit.onclick = async function () {

    var userVal = userInp.value
    var pwdVal = pwdInp.value
    console.log(userVal, pwdVal);
    var { status, message, user } = await loginAccount({ account: userVal, pwd: pwdVal })

    if (status) {
        setCookie('lgc', user)
        var url = urlParamsParse()
        console.log(url)
        var { ReturnUrl } = url
        console.log('re   : ' + ReturnUrl)
        if (ReturnUrl) { //其他页面条过来
            location.href = ReturnUrl
            console.log('re   : ' + ReturnUrl)
        }
        else {
            location.href = './index.html'
        }
    } else {
        alert(message)
    }
}

